<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0px; padding: 0px }
  #map_canvas { height: 200px;width: 200px }
</style>
<title>Google Maps JavaScript API v3 Example: Map Simple</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="jquery-1.4.4.js"></script>

<script type="text/javascript">
var map_gl;
var arrayMarkers_gl=[];

function initialize() {
  /*  var myLatlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
      zoom: 8,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);  */ 
	
	$("#ity input[type=button]").bind("click", function(event) {

		codeAddress(event.target);} );     
  }

  function codeAddress(target){
	var btName= $(target).attr("name");	
	var addr= $('input[type="text"][name$="'+btName.concat(":val")+'"]').val();
	
	



		var div= $('#ity_dept_show'); 

	/*per ogni localizzazione*/
	var link= $('<a></a>',{href:'#', id:'prova'}).append('show link');

	link.bind('click', function(event){
		alert($(event.target).attr('href')); 
		/*create marker on map*/
		/*
		function clearOverlays() {
			  if (markersArray) {
			    for (i in markersArray) {
			      markersArray[i].setMap(null);
			    }
			  }
			}
		
		*/
		})
	
	var li= $('<li></li>').append(link);
	var ul= $('<ul></ul>').append(li);
	$(div).replaceWith(ul);
	 
  }  

  $(function(){
		initialize();
		});
</script>

</head>
<body>
  <div id="ity" style="width=400px; height:400px; float:left;background-color:#96FFCE;">
  	<div>
  		<span>partenza</span>
  		<input name="ity:dep:val" type="text" value=""/>
  		<input name="ity:dep" type="button" value="search" >
  	</div>
  	<div id="ity_dept_show"></div>
  	<div>
  		<span>arrivo</span>
  		<input name="ity:arr:val" type="text" value=""/>
  		<input name="ity:arr" type="button" value="search">
  	</div>  	
  	<div id="ity_arr_show"></div>
  </div>
 
  <div style=" float:left; width:400px; height:400px; background-color:#F5CEE8;">	
  RIGHT DIV
	</div>
 <!--   <div id="map_canvas" style="width=400px; height:400px; float:left;"></div>  -->
</body>
</html>
